<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>高考祝福抽签</title>
    <style>
        body {
            font-family: 'Microsoft YaHei', sans-serif;
            text-align: center;
            background-color: #f5f5f5;
            padding: 20px;
            background-image: linear-gradient(120deg, #f6d365 0%, #fda085 100%);
            min-height: 100vh;
        }
        .container {
            max-width: 600px;
            margin: 0 auto;
            background-color: rgba(255, 255, 255, 0.9);
            padding: 30px;
            border-radius: 15px;
            box-shadow: 0 10px 20px rgba(0,0,0,0.1);
        }
        h1 {
            color: #e74c3c;
            text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
            margin-bottom: 30px;
        }
        .lottery-btn {
            background-color: #e74c3c;
            color: white;
            border: none;
            padding: 15px 30px;
            font-size: 20px;
            border-radius: 50px;
            cursor: pointer;
            margin: 30px 0;
            transition: all 0.3s;
            box-shadow: 0 4px 8px rgba(0,0,0,0.1);
        }
        .lottery-btn:hover {
            background-color: #c0392b;
            transform: translateY(-3px);
            box-shadow: 0 6px 12px rgba(0,0,0,0.15);
        }
        .lottery-btn:active {
            transform: translateY(1px);
        }
        .result-container {
            position: relative;
            margin: 30px 0;
            perspective: 1000px;
        }
        .result {
            font-size: 24px;
            min-height: 150px;
            padding: 30px;
            border: 3px solid #e74c3c;
            border-radius: 10px;
            background-color: #fff;
            box-shadow: 0 5px 15px rgba(0,0,0,0.05);
            transition: all 0.5s;
            transform-style: preserve-3d;
            background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><text x="10" y="20" font-family="Arial" font-size="15" fill="rgba(231, 76, 60, 0.1)">金榜题名</text></svg>');
        }
        .result.flip {
            transform: rotateY(180deg);
        }
        .share-section {
            margin-top: 30px;
            padding: 20px;
            background-color: #f8f9fa;
            border-radius: 10px;
            display: none;
        }
        .url-input {
            width: 80%;
            padding: 10px;
            border: 1px solid #ddd;
            border-radius: 5px;
            margin-right: 10px;
        }
        .copy-btn {
            background-color: #3498db;
            color: white;
            border: none;
            padding: 10px 20px;
            border-radius: 5px;
            cursor: pointer;
            transition: background-color 0.3s;
        }
        .copy-btn:hover {
            background-color: #2980b9;
        }
        .signature {
            margin-top: 30px;
            color: #7f8c8d;
            font-size: 14px;
        }
        @media (max-width: 600px) {
            .container {
                padding: 20px;
            }
            .result {
                font-size: 20px;
                padding: 20px;
            }
        }
    </style>
</head>
<body>
    <div class="container">
        <h1>🎓 高考祝福抽签 🎓</h1>
        <p>点击下方按钮抽取你的专属高考祝福</p>
        
        <button class="lottery-btn" onclick="drawLottery()">抽取祝福</button>
        
        <div class="result-container">
            <div class="result" id="result">
                <div style="display: flex; justify-content: center; align-items: center; height: 100%;">
                    <p>你的高考祝福将在这里显示</p>
                </div>
            </div>
        </div>
        
        <div class="share-section" id="shareSection">
            <h3>分享这份祝福</h3>
            <div style="display: flex; align-items: center; justify-content: center;">
                <input type="text" id="urlInput" class="url-input" readonly>
                <button class="copy-btn" onclick="copyUrl()">复制</button>
            </div>
            <p style="margin-top: 10px; font-size: 14px; color: #7f8c8d;">复制链接发送给朋友，传递这份祝福</p>
        </div>
        
        <div class="signature">
            为高考学子加油！愿你金榜题名，前程似锦！
        </div>
    </div>

    <script>
        // 高考祝福语库
        const blessings = [
            { text: "金榜题名，一举高中！", emoji: "🏆" },
            { text: "前程似锦，未来可期！", emoji: "🌈" },
            { text: "笔锋所至，梦想开花！", emoji: "✍️" },
            { text: "超常发挥，考神附体！", emoji: "🎯" },
            { text: "旗开得胜，马到成功！", emoji: "🚩" },
            { text: "心想事成，如愿以偿！", emoji: "💫" },
            { text: "智慧如海，答题如神！", emoji: "🧠" },
            { text: "沉着冷静，超常发挥！", emoji: "❄️" },
            { text: "十年寒窗，一朝成名！", emoji: "📚" },
            { text: "考的全会，蒙的全对！", emoji: "🎲" },
            { text: "文思泉涌，下笔有神！", emoji: "🖋️" },
            { text: "信心满满，高分在握！", emoji: "💯" },
            { text: "一举夺魁，清华北大！", emoji: "🎓" },
            { text: "稳定发挥，名校在望！", emoji: "🏫" },
            { text: "考场得意，人生如意！", emoji: "😊" },
            { text: "思路清晰，答题流畅！", emoji: "🌀" },
            { text: "超水平发挥，创最佳成绩！", emoji: "🚀" },
            { text: "心态平和，发挥稳定！", emoji: "☯️" },
            { text: "志存高远，脚踏实地！", emoji: "👣" },
            { text: "梦想成真，青春无悔！", emoji: "🌟" }
        ];

        // 抽签函数
        function drawLottery() {
            const resultElement = document.getElementById('result');
            
            // 添加翻转动画
            resultElement.classList.add('flip');
            
            // 动画结束后显示新内容
            setTimeout(() => {
                const randomIndex = Math.floor(Math.random() * blessings.length);
                const blessing = blessings[randomIndex];
                
                resultElement.innerHTML = `
                    <div style="text-align: center;">
                        <div style="font-size: 40px; margin-bottom: 15px;">${blessing.emoji}</div>
                        <div style="font-weight: bold; font-size: 26px; color: #e74c3c;">${blessing.text}</div>
                    </div>
                `;
                
                // 生成分享URL
                const url = window.location.href.split('?')[0] + `?blessing=${encodeURIComponent(blessing.text)}&emoji=${encodeURIComponent(blessing.emoji)}`;
                document.getElementById('urlInput').value = url;
                document.getElementById('shareSection').style.display = 'block';
                
                // 更新浏览器地址栏但不刷新页面
                history.pushState(null, null, url);
                
                // 移除翻转类以准备下一次动画
                setTimeout(() => {
                    resultElement.classList.remove('flip');
                }, 10);
            }, 500);
        }

        // 复制URL函数
        function copyUrl() {
            const urlInput = document.getElementById('urlInput');
            urlInput.select();
            document.execCommand('copy');
            
            // 显示复制成功提示
            const copyBtn = document.querySelector('.copy-btn');
            const originalText = copyBtn.textContent;
            copyBtn.textContent = '已复制!';
            setTimeout(() => {
                copyBtn.textContent = originalText;
            }, 2000);
        }

        // 页面加载时检查URL参数
        window.onload = function() {
            const urlParams = new URLSearchParams(window.location.search);
            const blessingParam = urlParams.get('blessing');
            const emojiParam = urlParams.get('emoji');
            
            if (blessingParam && emojiParam) {
                const blessing = decodeURIComponent(blessingParam);
                const emoji = decodeURIComponent(emojiParam);
                
                document.getElementById('result').innerHTML = `
                    <div style="text-align: center;">
                        <div style="font-size: 40px; margin-bottom: 15px;">${emoji}</div>
                        <div style="font-weight: bold; font-size: 26px; color: #e74c3c;">${blessing}</div>
                    </div>
                `;
                document.getElementById('shareSection').style.display = 'block';
                document.getElementById('urlInput').value = window.location.href;
            }
        };
    </script>
</body>
</html>